package com.cfpl.project_common.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 环境监测数据表
 * @TableName environmental_monitoring
 */
@TableName(value ="environmental_monitoring")
@Data
public class EnvironmentalMonitoring implements Serializable {
    /**
     * 
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 果蔬管理id,fk
     */
    private Long vegetableManagementId;

    /**
     * 温度
     */
    private Double temperature;

    /**
     * 湿度
     */
    private Double humidity;

    /**
     * 光照
     */
    private Double illumination;

    /**
     * 监测时间
     */
    private Date monitoringDate;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        EnvironmentalMonitoring other = (EnvironmentalMonitoring) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getVegetableManagementId() == null ? other.getVegetableManagementId() == null : this.getVegetableManagementId().equals(other.getVegetableManagementId()))
            && (this.getTemperature() == null ? other.getTemperature() == null : this.getTemperature().equals(other.getTemperature()))
            && (this.getHumidity() == null ? other.getHumidity() == null : this.getHumidity().equals(other.getHumidity()))
            && (this.getIllumination() == null ? other.getIllumination() == null : this.getIllumination().equals(other.getIllumination()))
            && (this.getMonitoringDate() == null ? other.getMonitoringDate() == null : this.getMonitoringDate().equals(other.getMonitoringDate()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getVegetableManagementId() == null) ? 0 : getVegetableManagementId().hashCode());
        result = prime * result + ((getTemperature() == null) ? 0 : getTemperature().hashCode());
        result = prime * result + ((getHumidity() == null) ? 0 : getHumidity().hashCode());
        result = prime * result + ((getIllumination() == null) ? 0 : getIllumination().hashCode());
        result = prime * result + ((getMonitoringDate() == null) ? 0 : getMonitoringDate().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", vegetableManagementId=").append(vegetableManagementId);
        sb.append(", temperature=").append(temperature);
        sb.append(", humidity=").append(humidity);
        sb.append(", illumination=").append(illumination);
        sb.append(", monitoringDate=").append(monitoringDate);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}